<template>
  <div  class="Manage-layout-style">

    <el-row class="el-row-style">

      <el-col :span="4"  style="background: #545c64" >
        <Sidebar></Sidebar>
      </el-col>
      <el-col :span="20">
        <Navbar></Navbar>
        <AppMain style="padding: 20px;"></AppMain>
      </el-col>
    </el-row>

  </div>
</template>

<script>
import Sidebar from "@/views/Back/Manage/components/Sidebar";
import AppMain from "@/views/Back/Manage/components/AppMain";
import Navbar from "@/views/Back/Company/components/Navbar";
import axios from 'axios'

export default {
  name: 'Manage',
  components:{
    Sidebar,
    AppMain,
    Navbar
  },
  created: function() {
    var _this=this
    // console.log(JSON.parse(localStorage.getItem("Token"))[0]["Token"])
    console.log(JSON.parse(localStorage.getItem("Token")))
    axios.post('http://localhost:8080/getLoginInfo',JSON.parse(localStorage.getItem("Token"))[0])
      .then(function (response) {

        //commit调用mutation中的函数，而第二个参数为commit调用方法中的入参

        if(response.data.role_type !== 'manage'){
          _this.$router.replace('/Home')
        }

      })
      .catch(function (error) {
        console.log(error);
      });

  },

}
</script>

<style scoped>


.Manage-layout-style{
  height: 100%;
  min-height: 100%;
  background: #e0e0e0;
}

.el-row-style{
  height: 100%;
}

</style>

